﻿@model IEnumerable<SystemContainer.Models.Combination>

@{
    ViewBag.Title = "Index";
}


<h1>Upload Algorithm files and dataset files</h1>
<br/><br/>

<p>
    Upload an algorithm file(.dll)：
</p>

@using (Html.BeginForm("uploadAlgorithm", "UploadFile", FormMethod.Post, new {enctype="multipart/form-data"})) 
   {
     <input type="file" name="FileUploada" />
    <br/>
     <input type="submit" name="Submit" id="submita" value="Upload" />
 }
<br/>

<p>
    Upload a data file(.csv)：
</p>

@using (Html.BeginForm("uploadDataset", "UploadFile", FormMethod.Post, new {enctype="multipart/form-data"})) 
   {
     <input type="file" name="FileUploadd" />
    <br/>
     <input type="submit" name="Submit" id="submitd" value="Upload" />
 }
<br/>
<br/>
<br/>


@using (Html.BeginForm("Match", "UploadFile"))
{
   
<table>
    <tr>
        <th>
            Choose an algorithm　　　　　
        </th>
        <th>
            Choose a check-in data File　　　
        </th>
        <th>
            Choose a photo data file　　　　
        </th>
        <th>
            Choose a city　　　　　　　　
        </th>
       
    </tr>
<br/>
<br/>
    <tr>
        <td>
            @Html.DropDownList("Algorithms", String.Empty)
        </td>
        <td>
            @Html.DropDownList("CheckIns", String.Empty)
        </td>
        <td>
            @Html.DropDownList("PhotoDatas", String.Empty)
        </td>
        <td>
           @Html.DropDownList("City", String.Empty)
        </td>
        
    </tr>
  
</table>
<br/>
<br/>
<br/>
<br/>
<br/>
<p>
   <input type="submit" value="Create a new mapping" />
</p>

}

<br/>
<br/>
<br/>
<p>
   Existing algorithms &datasets mapping: 
</p> 

<table>
    <tr>
        <th>
            AlgorithmName　　　　　
        </th>
        <th>
            CheckInDataName　　　　　
        </th>
        <th>
            PhotoDataName　　　　　
        </th>
        <th>
            City　　　　　　　　
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.AlgorithmName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CheckInDataName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PhotoDataName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.City)
        </td>
        <td>
            @Html.ActionLink("Delete", "DeleteDatasetRelation", new { combinationId = item.CombinationID })
        </td>
    </tr>
}
   
</table>

